namespace QMVnSoft.Invoices
{
    using QMVnSoft;
    using QMVnSoft.Controls;
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;

    public class FormCTKTUNCEditor : FormControl
    {
        private GBoxControl Box_A;
        private GBoxControl Box_B;
        private BtnControl btnClose;
        private BtnControl btnOk;
        private IContainer components;
        private bool ib_CheckAccepted;
        private LabelControl lblTen_Dvi_A;
        private LabelControl lblTen_Dvi_B;
        private LabelControl lblTen_NH_A;
        private LabelControl lblTen_NH_B;
        private LabelControl lblTen_TP_A;
        private LabelControl lblTen_TP_B;
        private LabelControl lblTk_NH_A;
        private LabelControl lblTk_NH_B;
        private TextControl txtTen_Dvi_A;
        private TextControl txtTen_Dvi_B;
        private TextControl txtTen_NH_A;
        private TextControl txtTen_NH_B;
        private TextControl txtTen_TP_A;
        private TextControl txtTen_TP_B;
        private TextControl txtTk_NH_A;
        private TextControl txtTk_NH_B;

        public FormCTKTUNCEditor(object ps_Ten_Dvi_A, object ps_Tk_NH_A, object ps_Ten_NH_A, object ps_Ten_TP_A, object ps_Ten_Dvi_B, object ps_Tk_NH_B, object ps_Ten_NH_B, object ps_Ten_TP_B)
        {
            this.InitializeComponent();
            if (!string.IsNullOrEmpty(ps_Tk_NH_A.ToString()))
            {
                this.Ten_Dvi_A = ps_Ten_Dvi_A;
                this.Tk_NH_A = ps_Tk_NH_A;
                this.Ten_NH_A = ps_Ten_NH_A;
                this.Ten_TP_A = ps_Ten_TP_A;
            }
            else
            {
                this.Ten_Dvi_A = string.IsNullOrEmpty(AppInstance.NameOfSubEnterprice) ? AppInstance.NameOfEnterprise : AppInstance.NameOfSubEnterprice;
                this.Tk_NH_A = AppInstance.BankAccount;
                this.Ten_NH_A = AppInstance.BankName;
                this.Ten_TP_A = AppInstance.BankCapital;
            }
            this.Ten_Dvi_B = ps_Ten_Dvi_B;
            this.Tk_NH_B = ps_Tk_NH_B;
            this.Ten_NH_B = ps_Ten_NH_B;
            this.Ten_TP_B = ps_Ten_TP_B;            
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            base.Close();
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            this.CheckAccepted = true;
            base.Close();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            //ComponentResourceManager manager = new ComponentResourceManager(typeof(FormCTKTUNCEditor));
            this.lblTen_Dvi_A = new LabelControl();
            this.Box_A = new GBoxControl();
            this.txtTen_Dvi_A = new TextControl();
            this.lblTk_NH_A = new LabelControl();
            this.txtTk_NH_A = new TextControl();
            this.lblTen_NH_A = new LabelControl();
            this.txtTen_NH_A = new TextControl();
            this.lblTen_TP_A = new LabelControl();
            this.txtTen_TP_A = new TextControl();
            this.Box_B = new GBoxControl();
            this.txtTen_TP_B = new TextControl();
            this.lblTen_TP_B = new LabelControl();
            this.txtTen_NH_B = new TextControl();
            this.lblTen_NH_B = new LabelControl();
            this.txtTk_NH_B = new TextControl();
            this.lblTk_NH_B = new LabelControl();
            this.txtTen_Dvi_B = new TextControl();
            this.lblTen_Dvi_B = new LabelControl();
            this.btnClose = new BtnControl();
            this.btnOk = new BtnControl();
            this.Box_A.SuspendLayout();
            this.Box_B.SuspendLayout();
            base.SuspendLayout();
            this.lblTen_Dvi_A.AutoSize = true;
            this.lblTen_Dvi_A.Font = new Font("Arial", 8.25f);
            this.lblTen_Dvi_A.Location = new Point(6, 0x16);
            this.lblTen_Dvi_A.Name = "lblTen_Dvi_A";
            this.lblTen_Dvi_A.Size = new Size(0x3a, 14);
            this.lblTen_Dvi_A.TabIndex = 0;
            this.lblTen_Dvi_A.Text = "Tên đơn vị";
            this.Box_A.Controls.Add(this.txtTen_TP_A);
            this.Box_A.Controls.Add(this.lblTen_TP_A);
            this.Box_A.Controls.Add(this.txtTen_NH_A);
            this.Box_A.Controls.Add(this.lblTen_NH_A);
            this.Box_A.Controls.Add(this.txtTk_NH_A);
            this.Box_A.Controls.Add(this.lblTk_NH_A);
            this.Box_A.Controls.Add(this.txtTen_Dvi_A);
            this.Box_A.Controls.Add(this.lblTen_Dvi_A);
            this.Box_A.Font = new Font("Arial", 8.25f);
            this.Box_A.Location = new Point(12, 12);
            this.Box_A.Name = "Box_A";
            this.Box_A.Size = new Size(0x1f8, 0x6c);
            this.Box_A.TabIndex = 0;
            this.Box_A.TabStop = false;
            this.Box_A.Text = "Đơn vị trả tiền";
            this.txtTen_Dvi_A.CheckTextSearched = false;
            this.txtTen_Dvi_A.DisabledForeColor = Color.Blue;
            this.txtTen_Dvi_A.Font = new Font("Arial", 8.25f);
            this.txtTen_Dvi_A.Location = new Point(0x6a, 0x13);
            this.txtTen_Dvi_A.MaxLength = 128;
            this.txtTen_Dvi_A.Name = "txtTen_Dvi_A";
            this.txtTen_Dvi_A.OldValue = null;
            this.txtTen_Dvi_A.Size = new Size(0x188, 20);
            this.txtTen_Dvi_A.TabIndex = 0;
            this.txtTen_Dvi_A.UserTextLength = AppInstance.TextControlLength.ItemDescription;
//            this.txtTen_Dvi_A.Value = null;//manager.GetObject("txtTen_Dvi_A.Value");
            this.lblTk_NH_A.AutoSize = true;
            this.lblTk_NH_A.Font = new Font("Arial", 8.25f);
            this.lblTk_NH_A.Location = new Point(6, 0x2b);
            this.lblTk_NH_A.Name = "lblTk_NH_A";
            this.lblTk_NH_A.Size = new Size(0x42, 14);
            this.lblTk_NH_A.TabIndex = 0;
            this.lblTk_NH_A.Text = "Số tài khoản";
            this.txtTk_NH_A.CheckTextSearched = false;
            this.txtTk_NH_A.DisabledForeColor = Color.Blue;
            this.txtTk_NH_A.Font = new Font("Arial", 8.25f);
            this.txtTk_NH_A.Location = new Point(0x6a, 40);
            this.txtTk_NH_A.MaxLength = 0x20;
            this.txtTk_NH_A.Name = "txtTk_NH_A";
            this.txtTk_NH_A.OldValue = null;
            this.txtTk_NH_A.Size = new Size(0x188, 20);
            this.txtTk_NH_A.TabIndex = 1;
            this.txtTk_NH_A.UserTextLength = AppInstance.TextControlLength.ItemCode;
//            this.txtTk_NH_A.Value = null;//manager.GetObject("txtTk_NH_A.Value");
            this.lblTen_NH_A.AutoSize = true;
            this.lblTen_NH_A.Font = new Font("Arial", 8.25f);
            this.lblTen_NH_A.Location = new Point(6, 0x40);
            this.lblTen_NH_A.Name = "lblTen_NH_A";
            this.lblTen_NH_A.Size = new Size(90, 14);
            this.lblTen_NH_A.TabIndex = 0;
            this.lblTen_NH_A.Text = "Mở tại ngân hàng";
            this.txtTen_NH_A.CheckTextSearched = false;
            this.txtTen_NH_A.DisabledForeColor = Color.Blue;
            this.txtTen_NH_A.Font = new Font("Arial", 8.25f);
            this.txtTen_NH_A.Location = new Point(0x6a, 0x3d);
            this.txtTen_NH_A.MaxLength = 128;
            this.txtTen_NH_A.Name = "txtTen_NH_A";
            this.txtTen_NH_A.OldValue = null;
            this.txtTen_NH_A.Size = new Size(0x188, 20);
            this.txtTen_NH_A.TabIndex = 2;
            this.txtTen_NH_A.UserTextLength = AppInstance.TextControlLength.ItemDescription;
//            this.txtTen_NH_A.Value = null;//manager.GetObject("txtTen_NH_A.Value");
            this.lblTen_TP_A.AutoSize = true;
            this.lblTen_TP_A.Font = new Font("Arial", 8.25f);
            this.lblTen_TP_A.Location = new Point(6, 0x55);
            this.lblTen_TP_A.Name = "lblTen_TP_A";
            this.lblTen_TP_A.Size = new Size(0x51, 14);
            this.lblTen_TP_A.TabIndex = 0;
            this.lblTen_TP_A.Text = "Tỉnh, thành phố";
            this.txtTen_TP_A.CheckTextSearched = false;
            this.txtTen_TP_A.DisabledForeColor = Color.Blue;
            this.txtTen_TP_A.Font = new Font("Arial", 8.25f);
            this.txtTen_TP_A.Location = new Point(0x6a, 0x52);
            this.txtTen_TP_A.MaxLength = 128;
            this.txtTen_TP_A.Name = "txtTen_TP_A";
            this.txtTen_TP_A.OldValue = null;
            this.txtTen_TP_A.Size = new Size(0x188, 20);
            this.txtTen_TP_A.TabIndex = 3;
            this.txtTen_TP_A.UserTextLength = AppInstance.TextControlLength.ItemDescription;
//            this.txtTen_TP_A.Value = null;//manager.GetObject("txtTen_TP_A.Value");
            this.Box_B.Controls.Add(this.txtTen_TP_B);
            this.Box_B.Controls.Add(this.lblTen_TP_B);
            this.Box_B.Controls.Add(this.txtTen_NH_B);
            this.Box_B.Controls.Add(this.lblTen_NH_B);
            this.Box_B.Controls.Add(this.txtTk_NH_B);
            this.Box_B.Controls.Add(this.lblTk_NH_B);
            this.Box_B.Controls.Add(this.txtTen_Dvi_B);
            this.Box_B.Controls.Add(this.lblTen_Dvi_B);
            this.Box_B.Font = new Font("Arial", 8.25f);
            this.Box_B.Location = new Point(12, 0x7e);
            this.Box_B.Name = "Box_B";
            this.Box_B.Size = new Size(0x1f8, 0x6c);
            this.Box_B.TabIndex = 1;
            this.Box_B.TabStop = false;
            this.Box_B.Text = "Đơn vị nhận tiền";
            this.txtTen_TP_B.CheckTextSearched = false;
            this.txtTen_TP_B.DisabledForeColor = Color.Blue;
            this.txtTen_TP_B.Font = new Font("Arial", 8.25f);
            this.txtTen_TP_B.Location = new Point(0x6a, 0x52);
            this.txtTen_TP_B.MaxLength = 128;
            this.txtTen_TP_B.Name = "txtTen_TP_B";
            this.txtTen_TP_B.OldValue = null;
            this.txtTen_TP_B.Size = new Size(0x188, 20);
            this.txtTen_TP_B.TabIndex = 3;
            this.txtTen_TP_B.UserTextLength = AppInstance.TextControlLength.ItemDescription;
//            this.txtTen_TP_B.Value = null;//manager.GetObject("txtTen_TP_B.Value");
            this.lblTen_TP_B.AutoSize = true;
            this.lblTen_TP_B.Font = new Font("Arial", 8.25f);
            this.lblTen_TP_B.Location = new Point(6, 0x55);
            this.lblTen_TP_B.Name = "lblTen_TP_B";
            this.lblTen_TP_B.Size = new Size(0x51, 14);
            this.lblTen_TP_B.TabIndex = 0;
            this.lblTen_TP_B.Text = "Tỉnh, thành phố";
            this.txtTen_NH_B.CheckTextSearched = false;
            this.txtTen_NH_B.DisabledForeColor = Color.Blue;
            this.txtTen_NH_B.Font = new Font("Arial", 8.25f);
            this.txtTen_NH_B.Location = new Point(0x6a, 0x3d);
            this.txtTen_NH_B.MaxLength = 128;
            this.txtTen_NH_B.Name = "txtTen_NH_B";
            this.txtTen_NH_B.OldValue = null;
            this.txtTen_NH_B.Size = new Size(0x188, 20);
            this.txtTen_NH_B.TabIndex = 2;
            this.txtTen_NH_B.UserTextLength = AppInstance.TextControlLength.ItemDescription;
//            this.txtTen_NH_B.Value = null;//manager.GetObject("txtTen_NH_B.Value");
            this.lblTen_NH_B.AutoSize = true;
            this.lblTen_NH_B.Font = new Font("Arial", 8.25f);
            this.lblTen_NH_B.Location = new Point(6, 0x40);
            this.lblTen_NH_B.Name = "lblTen_NH_B";
            this.lblTen_NH_B.Size = new Size(90, 14);
            this.lblTen_NH_B.TabIndex = 0;
            this.lblTen_NH_B.Text = "Mở tại ngân hàng";
            this.txtTk_NH_B.CheckTextSearched = false;
            this.txtTk_NH_B.DisabledForeColor = Color.Blue;
            this.txtTk_NH_B.Font = new Font("Arial", 8.25f);
            this.txtTk_NH_B.Location = new Point(0x6a, 40);
            this.txtTk_NH_B.MaxLength = 0x20;
            this.txtTk_NH_B.Name = "txtTk_NH_B";
            this.txtTk_NH_B.OldValue = null;
            this.txtTk_NH_B.Size = new Size(0x188, 20);
            this.txtTk_NH_B.TabIndex = 1;
            this.txtTk_NH_B.UserTextLength = AppInstance.TextControlLength.ItemCode;
//            this.txtTk_NH_B.Value = null;//manager.GetObject("txtTk_NH_B.Value");
            this.lblTk_NH_B.AutoSize = true;
            this.lblTk_NH_B.Font = new Font("Arial", 8.25f);
            this.lblTk_NH_B.Location = new Point(6, 0x2b);
            this.lblTk_NH_B.Name = "lblTk_NH_B";
            this.lblTk_NH_B.Size = new Size(0x42, 14);
            this.lblTk_NH_B.TabIndex = 0;
            this.lblTk_NH_B.Text = "Số tài khoản";
            this.txtTen_Dvi_B.CheckTextSearched = false;
            this.txtTen_Dvi_B.DisabledForeColor = Color.Blue;
            this.txtTen_Dvi_B.Font = new Font("Arial", 8.25f);
            this.txtTen_Dvi_B.Location = new Point(0x6a, 0x13);
            this.txtTen_Dvi_B.MaxLength = 128;
            this.txtTen_Dvi_B.Name = "txtTen_Dvi_B";
            this.txtTen_Dvi_B.OldValue = null;
            this.txtTen_Dvi_B.Size = new Size(0x188, 20);
            this.txtTen_Dvi_B.TabIndex = 0;
            this.txtTen_Dvi_B.UserTextLength = AppInstance.TextControlLength.ItemDescription;
//            this.txtTen_Dvi_B.Value = null;//manager.GetObject("txtTen_Dvi_B.Value");
            this.lblTen_Dvi_B.AutoSize = true;
            this.lblTen_Dvi_B.Font = new Font("Arial", 8.25f);
            this.lblTen_Dvi_B.Location = new Point(6, 0x16);
            this.lblTen_Dvi_B.Name = "lblTen_Dvi_B";
            this.lblTen_Dvi_B.Size = new Size(0x3a, 14);
            this.lblTen_Dvi_B.TabIndex = 0;
            this.lblTen_Dvi_B.Text = "Tên đơn vị";
            this.btnClose.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            //this.btnClose.DialogResult = DialogResult.Cancel;
            this.btnClose.Font = new Font("Arial", 8.25f);
            this.btnClose.Location = new Point(0x10b, 0xfb);
            this.btnClose.Name = "btnClose";
            this.btnClose.Size = new Size(0x67, 0x17);
            this.btnClose.TabIndex = 3;
            this.btnClose.Text = "&Huỷ bỏ";
            this.btnClose.UseVisualStyleBackColor = true;
            this.btnClose.Click += new EventHandler(this.btnClose_Click);
            this.btnOk.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.btnOk.Font = new Font("Arial", 8.25f);
            this.btnOk.Location = new Point(0x9e, 0xfb);
            this.btnOk.Name = "btnOk";
            this.btnOk.Size = new Size(0x67, 0x17);
            this.btnOk.TabIndex = 2;
            this.btnOk.Text = "&Chấp nhận";
            this.btnOk.UseVisualStyleBackColor = true;
            this.btnOk.Click += new EventHandler(this.btnOk_Click);
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.CancelButton = this.btnClose;
            base.ClientSize = new Size(0x210, 0x11e);
            base.Controls.Add(this.btnClose);
            base.Controls.Add(this.btnOk);
            base.Controls.Add(this.Box_B);
            base.Controls.Add(this.Box_A);
            //base.FormBorderStyle = FormBorderStyle.FixedDialog;
            base.MaximizeBox = false;
            base.MinimizeBox = false;
            base.Name = "FormCTKTUNCEditor";
            this.Text = "Uỷ nhiệm chi";
            this.Box_A.ResumeLayout(false);
            this.Box_A.PerformLayout();
            this.Box_B.ResumeLayout(false);
            this.Box_B.PerformLayout();
            base.ResumeLayout(false);
        }

        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            if (keyData == (Keys.Control | Keys.Return))
            {
                this.CheckAccepted = true;
                base.Close();
            }
            return base.ProcessCmdKey(ref msg, keyData);
        }

        public bool CheckAccepted
        {
            get
            {
                return this.ib_CheckAccepted;
            }
            set
            {
                this.ib_CheckAccepted = value;
            }
        }

        public object Ten_Dvi_A
        {
            get
            {
                return this.txtTen_Dvi_A.Value;
            }
            set
            {
                this.txtTen_Dvi_A.Value = value;
            }
        }

        public object Ten_Dvi_B
        {
            get
            {
                return this.txtTen_Dvi_B.Value;
            }
            set
            {
                this.txtTen_Dvi_B.Value = value;
            }
        }

        public object Ten_NH_A
        {
            get
            {
                return this.txtTen_NH_A.Value;
            }
            set
            {
                this.txtTen_NH_A.Value = value;
            }
        }

        public object Ten_NH_B
        {
            get
            {
                return this.txtTen_NH_B.Value;
            }
            set
            {
                this.txtTen_NH_B.Value = value;
            }
        }

        public object Ten_TP_A
        {
            get
            {
                return this.txtTen_TP_A.Value;
            }
            set
            {
                this.txtTen_TP_A.Value = value;
            }
        }

        public object Ten_TP_B
        {
            get
            {
                return this.txtTen_TP_B.Value;
            }
            set
            {
                this.txtTen_TP_B.Value = value;
            }
        }

        public object Tk_NH_A
        {
            get
            {
                return this.txtTk_NH_A.Value;
            }
            set
            {
                this.txtTk_NH_A.Value = value;
            }
        }

        public object Tk_NH_B
        {
            get
            {
                return this.txtTk_NH_B.Value;
            }
            set
            {
                this.txtTk_NH_B.Value = value;
            }
        }
    }
}

